package Arrays101.Test;

public class Test01 {
    public static void main(String[] args) {
        String s="123456";
        String s2="abcde";
        //获取元素 charAt()
        char c = s.charAt(0);
        System.out.println(c);
        //获取字符串长度 length()
        int length = s.length();
        System.out.println(length);
        //连接字符串 concat()
        String concat = s.concat(s2);
        System.out.println(concat);
        //拆分字符串 --->数组 split（）
        String[] split = s.split("3");
        //判断字符串是否为空
        boolean flag = s.isEmpty();
        System.out.println(flag);

        //添加元素
        StringBuffer stringBuffer = new StringBuffer();
        StringBuffer append = stringBuffer.append(s).append(s2);
        System.out.println(append);
        StringBuilder stringBuilder = new StringBuilder();
        StringBuilder append1 = stringBuilder.append(s).append(s2);
        System.out.println(append1);


    }

}
